package com.linkq.ipinyin.controller;

import com.linkq.ipinyin.model.TrailDetail;
import com.linkq.ipinyin.service.TrailDetailService;
import com.linkq.ipinyin.vo.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author wangpeng
 * @since 2025-07-12
 **/

@RestController()
@RequestMapping("/trail")
public class TrailDetailController {
    @Autowired
    private TrailDetailService trailDetailService;

    @PostMapping("/new")
    public ResultInfo newTrail(@RequestBody TrailDetail trailDetail) {
        return ResultInfo.success(trailDetailService.newTrail(trailDetail));
    }

    @PostMapping("/getCount")
    public ResultInfo getCount(@RequestBody TrailDetail trailDetail) {
        return ResultInfo.success(trailDetailService.getCount(trailDetail));
    }
}
